﻿Option Strict On
Option Explicit On 

Imports IP.Core.IPCommon
Imports IP.Core.IPUserService

''' -----------------------------------------------------------------------------
''' Project	 : IPSystemAdmin
''' Class	 : Core.IPSystemAdmin.f117_drop_down_loai_phan_quyen
''' 
''' -----------------------------------------------------------------------------
''' <summary>
''' Kiểm thử xem có làm được dropdown form ở đây không
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' 	[csung]	3/21/2005	Created
''' </history>
''' -----------------------------------------------------------------------------
Class f117_drop_down_loai_phan_quyen
    Inherits C1.Win.C1Input.DropDownForm


#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        format_controls()
    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents imageList As System.Windows.Forms.ImageList
    Friend WithEvents m_fg_select As C1.Win.C1FlexGrid.C1FlexGrid
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents m_cmd_chon As SIS.Controls.Button.SiSButton
    Friend WithEvents m_cmd_thoat As SIS.Controls.Button.SiSButton
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(f117_drop_down_loai_phan_quyen))
        Me.m_fg_select = New C1.Win.C1FlexGrid.C1FlexGrid
        Me.imageList = New System.Windows.Forms.ImageList(Me.components)
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.m_cmd_chon = New SIS.Controls.Button.SiSButton
        Me.m_cmd_thoat = New SIS.Controls.Button.SiSButton
        CType(Me.m_fg_select, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Panel1.SuspendLayout()
        Me.SuspendLayout()
        '
        'm_fg_select
        '
        Me.m_fg_select.ColumnInfo = "3,1,0,0,0,85,Columns:0{Width:10;}" & Microsoft.VisualBasic.ChrW(9) & "1{Width:187;Caption:""Mã loại phần quyền"";DataTy" & _
        "pe:System.String;TextAlign:LeftCenter;TextAlignFixed:CenterCenter;}" & Microsoft.VisualBasic.ChrW(9) & "2{Width:183;" & _
        "Caption:""Ghi chú"";DataType:System.String;TextAlign:LeftCenter;TextAlignFixed:Cen" & _
        "terCenter;}" & Microsoft.VisualBasic.ChrW(9)
        Me.m_fg_select.Dock = System.Windows.Forms.DockStyle.Fill
        Me.m_fg_select.ExtendLastCol = True
        Me.m_fg_select.KeyActionEnter = C1.Win.C1FlexGrid.KeyActionEnum.None
        Me.m_fg_select.Location = New System.Drawing.Point(0, 0)
        Me.m_fg_select.Name = "m_fg_select"
        Me.m_fg_select.Rows.Count = 4
        Me.m_fg_select.Size = New System.Drawing.Size(536, 296)
        Me.m_fg_select.Styles = New C1.Win.C1FlexGrid.CellStyleCollection("Normal{Font:Microsoft Sans Serif, 8.25pt;}" & Microsoft.VisualBasic.ChrW(9) & "Fixed{BackColor:Control;ForeColor:Cont" & _
        "rolText;Border:Flat,1,ControlDark,Both;}" & Microsoft.VisualBasic.ChrW(9) & "Highlight{BackColor:Highlight;ForeColor" & _
        ":HighlightText;}" & Microsoft.VisualBasic.ChrW(9) & "Search{BackColor:Highlight;ForeColor:HighlightText;}" & Microsoft.VisualBasic.ChrW(9) & "Frozen{Bac" & _
        "kColor:Beige;}" & Microsoft.VisualBasic.ChrW(9) & "EmptyArea{BackColor:AppWorkspace;Border:Flat,1,ControlDarkDark,Bo" & _
        "th;}" & Microsoft.VisualBasic.ChrW(9) & "GrandTotal{BackColor:Black;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal0{BackColor:ControlDar" & _
        "kDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal1{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Su" & _
        "btotal2{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal3{BackColor:ControlD" & _
        "arkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & "Subtotal4{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9) & _
        "Subtotal5{BackColor:ControlDarkDark;ForeColor:White;}" & Microsoft.VisualBasic.ChrW(9))
        Me.m_fg_select.TabIndex = 0
        '
        'imageList
        '
        Me.imageList.ImageSize = New System.Drawing.Size(16, 16)
        Me.imageList.ImageStream = CType(resources.GetObject("imageList.ImageStream"), System.Windows.Forms.ImageListStreamer)
        Me.imageList.TransparentColor = System.Drawing.Color.Transparent
        '
        'Panel1
        '
        Me.Panel1.Controls.Add(Me.m_cmd_chon)
        Me.Panel1.Controls.Add(Me.m_cmd_thoat)
        Me.Panel1.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.Panel1.DockPadding.All = 4
        Me.Panel1.Location = New System.Drawing.Point(0, 296)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(536, 32)
        Me.Panel1.TabIndex = 1
        '
        'm_cmd_chon
        '
        Me.m_cmd_chon.AdjustImageLocation = New System.Drawing.Point(0, 0)
        Me.m_cmd_chon.BtnShape = SIS.Controls.Button.emunType.BtnShape.Rectangle
        Me.m_cmd_chon.BtnStyle = SIS.Controls.Button.emunType.XPStyle.Default
        Me.m_cmd_chon.Dock = System.Windows.Forms.DockStyle.Right
        Me.m_cmd_chon.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.m_cmd_chon.ImageIndex = 9
        Me.m_cmd_chon.ImageList = Me.imageList
        Me.m_cmd_chon.Location = New System.Drawing.Point(308, 4)
        Me.m_cmd_chon.Name = "m_cmd_chon"
        Me.m_cmd_chon.Size = New System.Drawing.Size(112, 24)
        Me.m_cmd_chon.TabIndex = 19
        Me.m_cmd_chon.Text = "&Chọn"
        '
        'm_cmd_thoat
        '
        Me.m_cmd_thoat.AdjustImageLocation = New System.Drawing.Point(0, 0)
        Me.m_cmd_thoat.BtnShape = SIS.Controls.Button.emunType.BtnShape.Rectangle
        Me.m_cmd_thoat.BtnStyle = SIS.Controls.Button.emunType.XPStyle.Default
        Me.m_cmd_thoat.Dock = System.Windows.Forms.DockStyle.Right
        Me.m_cmd_thoat.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.m_cmd_thoat.ImageIndex = 6
        Me.m_cmd_thoat.ImageList = Me.imageList
        Me.m_cmd_thoat.Location = New System.Drawing.Point(420, 4)
        Me.m_cmd_thoat.Name = "m_cmd_thoat"
        Me.m_cmd_thoat.Size = New System.Drawing.Size(112, 24)
        Me.m_cmd_thoat.TabIndex = 18
        Me.m_cmd_thoat.Text = "&Thoát"
        '
        'f117_drop_down_loai_phan_quyen
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(536, 328)
        Me.Controls.Add(Me.m_fg_select)
        Me.Controls.Add(Me.Panel1)
        Me.FocusControl = Me.m_fg_select
        Me.Name = "f117_drop_down_loai_phan_quyen"
        Me.Options = CType((C1.Win.C1Input.DropDownFormOptionsFlags.Focusable Or C1.Win.C1Input.DropDownFormOptionsFlags.NoPostOnEnter), C1.Win.C1Input.DropDownFormOptionsFlags)
        Me.Text = "f117_drop_down_loai_phan_quyen"
        CType(Me.m_fg_select, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Panel1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub format_controls()
        CControlFormat.setC1FlexFormat(m_fg_select, C1GridStyle.GridViewAndSearch)
    End Sub

    Private Sub load_data()
        m_fg_select.Rows.Count = 1
        m_fg_select.Rows.Add()
        m_fg_select(1, 1) = "ADMIN"
        m_fg_select(1, 2) = "Quản trị hệ thống"
        m_fg_select.Rows.Add()
        m_fg_select(2, 1) = "TDDADTTT"
        m_fg_select(2, 2) = "Thẩm định dự án Đầu tư Trực tiếp"

    End Sub
    Private Sub f117_drop_down_loai_phan_quyen_OwnerControlTextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.OwnerControlTextChanged
        OwnerControl.OpenDropDown()
        'listBox1.SelectedIndex = listBox1.FindString(OwnerControl.Text)
        'tại đây ta phải focus vào record cần thiết

    End Sub

    Private Sub f117_drop_down_loai_phan_quyen_Open(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Open
        load_data()
    End Sub


    Private Sub m_fg_select_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles m_fg_select.KeyDown
        Select Case e.KeyCode
            Case Keys.Enter
                Me.CloseDropDown()
        End Select
    End Sub

    Private Sub f117_drop_down_loai_phan_quyen_PostChanges(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PostChanges
        Try
            Debug.WriteLine("post changes" & CType(m_fg_select(m_fg_select.Row, 2), String))
        Catch v_e As Exception
            CSystemLog_301.ExceptionHandle(v_e)
        End Try
    End Sub
End Class
